<%@ page import="com.sg.service.StudentService" %>
<%@ page import="com.sg.pojo.Student" %>
<%@ page import="java.util.Date" %>
<%@ page import="java.text.SimpleDateFormat" %><%--
  Created by IntelliJ IDEA.
  User: rosekon
  Date: 2022/7/1
  Time: 15:26
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>处理学生数据</title>
</head>
<body>
<%
    SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd");
    String stuName = request.getParameter("stuName");
    String sex = request.getParameter("sex");
    Date birth = sdf.parse(request.getParameter("birth"));
    String tele = request.getParameter("tele");
    String qq = request.getParameter("qq");
    String wechat = request.getParameter("wechat");
    int gradeId = Integer.parseInt(request.getParameter("gradeId"));
    Date enterDate = sdf.parse(request.getParameter("enterDate"));
    String city = request.getParameter("city");
    String address = request.getParameter("address");
    String pass = request.getParameter("pass");
    String pic = request.getParameter("pic");

    Student student = new Student(stuName,sex,tele,qq,wechat,gradeId,enterDate,city,
            birth,address,pass,pic);
    int add = StudentService.ME.add(student);
    if(add>0){
%>

<h2>添加成功</h2>
<%
}
else{
%>
<h2>添加失败</h2>
<%
    }
%>
</body>
</html>
